﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

namespace WT
{
    public partial class TabWell : Page
    {
        //int MonthDataRowHeight = 0;
		
		public TabWell()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void id_wellTextBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
        {
        	//wtdt_tab_wellDomainDataSource.Load();
        }

        private void yearTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            //wtdt_tab_wellDomainDataSource.Load();

        }

        private void wTDV_TAB_WELLDomainDataSource_LoadedData(object sender, LoadedDataEventArgs e)
        {
            //wTDV_TAB_WELL_ND_MONTH_DATADataGrid.RowHeight = (wTDV_TAB_WELLDomainDataSource.DataView.Count / 12) * wTDV_TAB_WELLDataGrid.RowHeight;
            //wTDV_TAB_WELL_ND_MONTH_DATADataGrid2.RowHeight = (wTDV_TAB_WELLDomainDataSource.DataView.Count / 12) * wTDV_TAB_WELLDataGrid.RowHeight;

            if (e.HasError)
            {
                System.Windows.MessageBox.Show(e.Error.ToString(), "Load Error", System.Windows.MessageBoxButton.OK);
                e.MarkErrorAsHandled();
            }
        }

        private void id_wellTextBox_TextChanged_1(object sender, TextChangedEventArgs e)
        {
            //wTDV_TAB_WELLDomainDataSource.Load();
        }

        private void wTDV_TAB_WELL_ND_MONTH_DATADomainDataSource_LoadedData(object sender, LoadedDataEventArgs e)
        {
            //wTDV_TAB_WELL_ND_MONTH_DATADataGrid.RowHeight = (wTDV_TAB_WELLDomainDataSource.DataView.Count / 12) * wTDV_TAB_WELLDataGrid.RowHeight;
            //wTDV_TAB_WELL_ND_MONTH_DATADataGrid2.RowHeight = (wTDV_TAB_WELLDomainDataSource.DataView.Count / 12) * wTDV_TAB_WELLDataGrid.RowHeight;

            if (e.HasError)
            {
                System.Windows.MessageBox.Show(e.Error.ToString(), "Load Error", System.Windows.MessageBoxButton.OK);
                e.MarkErrorAsHandled();
            }
        }

        private void wTDV_TAB_WELLDataGrid_VerticalScroll(object sender, System.Windows.Controls.Primitives.ScrollEventArgs e)
        {
            //wTDV_TAB_WELL_ND_MONTH_DATADataGrid.SetVerticalScrollPosition(wTDV_TAB_WELLDataGrid.verticalScrollBar.Value);
            //wTDV_TAB_WELL_ND_MONTH_DATADataGrid2.SetVerticalScrollPosition(wTDV_TAB_WELLDataGrid.verticalScrollBar.Value);
        }

        private void wTDV_TAB_WELLDomainDataSource1_LoadedData(object sender, LoadedDataEventArgs e)
        {

            if (e.HasError)
            {
                System.Windows.MessageBox.Show(e.Error.ToString(), "Load Error", System.Windows.MessageBoxButton.OK);
                e.MarkErrorAsHandled();
            }
        }

        private void wTDV_TAB_WELLDataGrid_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
        {
            //wTDV_TAB_WELL_ND_MONTH_DATADataGrid.SetVerticalScrollPosition(wTDV_TAB_WELLDataGrid.verticalScrollBar.Value);
            //wTDV_TAB_WELL_ND_MONTH_DATADataGrid2.SetVerticalScrollPosition(wTDV_TAB_WELLDataGrid.verticalScrollBar.Value);
        }

        private void wTDV_TAB_WELLDomainDataSource1_LoadedData_1(object sender, LoadedDataEventArgs e)
        {

            if (e.HasError)
            {
                System.Windows.MessageBox.Show(e.Error.ToString(), "Load Error", System.Windows.MessageBoxButton.OK);
                e.MarkErrorAsHandled();
            }
        }

        private void wTDV_TAB_WELL_ND_MONTH_DATADomainDataSource1_LoadedData(object sender, LoadedDataEventArgs e)
        {

            if (e.HasError)
            {
                System.Windows.MessageBox.Show(e.Error.ToString(), "Load Error", System.Windows.MessageBoxButton.OK);
                e.MarkErrorAsHandled();
            }
        }

        private void wTDV_TAB_WELL_ND_MONTH_DATADomainDataSource1_LoadedData_1(object sender, LoadedDataEventArgs e)
        {

            if (e.HasError)
            {
                System.Windows.MessageBox.Show(e.Error.ToString(), "Load Error", System.Windows.MessageBoxButton.OK);
                e.MarkErrorAsHandled();
            }
        }

        private void wTDV_TAB_WELLDomainDataSource1_LoadedData_2(object sender, LoadedDataEventArgs e)
        {

            if (e.HasError)
            {
                System.Windows.MessageBox.Show(e.Error.ToString(), "Load Error", System.Windows.MessageBoxButton.OK);
                e.MarkErrorAsHandled();
            }
        }


		/*
        private void Viewbox_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
        {
            double scalingFactor = (double)e.Delta / 110;

            // Check which way the wheel was turned. 
            if (scalingFactor > 0)
            {
                // Expand the viewbox. 
                viewbox.Width *= scalingFactor;
                viewbox.Height *= scalingFactor;
            }
            else
            {
                // Shrink the viewbox. 
                viewbox.Width /= -scalingFactor;
                viewbox.Height /= -scalingFactor;
            } 
        }*/

    }
}
